package com.xie.smfs.registry;

import com.xie.smfs.Smfs;
import com.xie.smfs.event.screen.GhostControlScreenHandler;
import net.fabricmc.fabric.api.screenhandler.v1.ExtendedScreenHandlerType;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.screen.ScreenHandlerType;
import net.minecraft.util.Identifier;

public class ModScreenHandlers {
    // 使用 ExtendedScreenHandlerType 并提供正确的构造函数引用
    public static final ScreenHandlerType<GhostControlScreenHandler> GHOST_CONTROL_SCREEN_HANDLER =
            new ExtendedScreenHandlerType<>((syncId, inventory, buf) -> new GhostControlScreenHandler(syncId, inventory, buf));

    // 初始化方法
    public static void registerScreenHandlers() {
        Registry.register(Registries.SCREEN_HANDLER,
                new Identifier(Smfs.MOD_ID, "ghost_control"),
                GHOST_CONTROL_SCREEN_HANDLER);

        Smfs.LOGGER.info("成功注册厉鬼控制屏幕处理器 - 模块ID: {}", Smfs.MOD_ID);
    }
}